home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / util / comm / arateleb.sit / Telebit T2500 next >
Text File  |  1992-10-27  |  3KB  |  207 lines

  1. ! "Telebit T2500 Modem - 10/26/92"
  2. @ORIGINATE
  3. @ANSWER
  4. !
  5. serreset 19200, 0, 8, 1
  6. !
  7. ! first set the factory configuration to Enhanced Command Mode
  8. !
  9. settries 0
  10. @LABEL 1
  11. pause 5
  12. matchclr
  13. matchstr 1 3 "OK\13\10"
  14. write "AT&F0\13"
  15. matchread 30
  16. inctries
  17. iftries 2 59
  18. ! Modem is not responding, reset and send a break
  19. DTRClear
  20. pause 5
  21. DTRSet
  22. SBreak
  23. jump 1
  24. !
  25. ! Turn off echo and flow control.  Reset when DTR is dropped.
  26. !    Turn on enhanced result codes.
  27. !
  28. @LABEL 3
  29. matchclr
  30. matchstr 1 4 "OK\13\10"
  31. write "AT E0 S58=0 S68=0 S52=1 X1\13"
  32. matchread 30
  33. jump 59
  34. !
  35. ! Turn off Error Control and buffering.
  36. !
  37. @LABEL 4
  38. pause 5
  39. matchclr
  40. matchstr 1 5 "OK\13\10"
  41. write "AT S95=0 S96=0 S97=0 S98=0 S66=0\13"
  42. matchread 30
  43. jump 59
  44. !
  45. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  46. !
  47. @LABEL 5
  48. pause 5
  49. ifstr 2 8 "1"
  50. matchstr 1 8 "OK\13\10"
  51. write "ATM0\13"
  52. matchread 30
  53. jump 59
  54. !
  55. ! The modem is ready so enable answering, or originate a call
  56. !
  57. @LABEL 8
  58. pause 5
  59. ifANSWER 30
  60. note "Dialing ^1" 3
  61. write "AT S0=0 DT^1\13"
  62. !
  63. @LABEL 9
  64. matchstr  1 11 "CONNECT 1200\13\10"
  65. matchstr  2 12 "CONNECT 2400\13\10"
  66. matchstr  3 13 "CONNECT 4800\13\10"
  67. matchstr  4 14 "CONNECT 9600\13\10"
  68. matchstr  5 15 "CONNECT FAST\13\10"
  69. matchstr  6 50 "NO CARRIER\13\10"
  70. matchstr  7 50 "ERROR\13\10"
  71. matchstr  8 52 "NO DIALTONE\13\10"
  72. matchstr  9 53 "BUSY\13\10"
  73. matchstr 10 54 "NO ANSWER\13\10"
  74. matchread 700
  75. jump 59
  76. !
  77. @LABEL 11
  78. note "Communicating at 1200 bps." 2
  79. serreset 1200, 0, 8, 1
  80. jump 16
  81. !
  82. @LABEL 12
  83. note "Communicating at 2400 bps." 2
  84. serreset 2400, 0, 8, 1
  85. jump 16
  86. !
  87. @LABEL 13
  88. note "Communicating at 4800 bps." 2
  89. serreset 4800, 0, 8, 1
  90. jump 16
  91. !
  92. @LABEL 14
  93. note "Communicating at 9600 bps." 2
  94. serreset 9600, 0, 8, 1
  95. jump 16
  96. !
  97. @LABEL 15
  98. note "Communicating at 19.2 kbps." 2
  99. serreset 19200, 0, 8, 1
  100. !
  101. @LABEL 16
  102. ifANSWER 17
  103. pause 30
  104. @LABEL 17
  105. exit 0
  106. !
  107. ! @ANSWER
  108. ! Set up the modem to answer
  109. @LABEL 30
  110. write "ATS0=1\13"
  111. matchstr 1 31 "OK\13\10"
  112. matchread 30
  113. jump 59
  114. !
  115. @LABEL 31
  116. matchstr 1  32 "RING\13\10"
  117. matchstr 2  11 "CONNECT 1200\13\10"
  118. matchstr 3  12 "CONNECT 2400\13\10"
  119. matchstr 4  13 "CONNECT 4800\13\10"
  120. matchstr 5  14 "CONNECT 9600\13\10"
  121. matchstr 6  15 "CONNECT FAST\13\10"
  122. matchstr 7  50 "NO CARRIER\13\10"
  123. matchstr 8  50 "ERROR\13\10"
  124. matchstr 9  52 "NO DIALTONE\13\10"
  125. matchstr 10 53 "BUSY\13\10"
  126. matchstr 11 54 "NO ANSWER\13\10"
  127. matchread 700
  128. jump 31
  129. !
  130. @LABEL 32
  131. userhook 1
  132. note "Answering phone╔" 2
  133. jump 31
  134. !
  135. ! 50: error messages
  136. !
  137. @LABEL 50
  138. exit -6021
  139. !
  140. @LABEL 52
  141. exit -6020
  142. !
  143. @LABEL 53
  144. exit -6022
  145. !
  146. @LABEL 54
  147. exit -6023
  148. !
  149. @LABEL 59
  150. exit -6019
  151. !
  152. ! Hang up the modem
  153. !
  154. @HANGUP
  155. @LABEL 60
  156. settries 0
  157. @LABEL 61
  158. pause 5
  159. write "ATH\13"
  160. matchclr
  161. matchstr 1 63 "OK\13\10"
  162. matchstr 2 63 "NO CARRIER\13\10"
  163. matchstr 3 63 "ERROR\13\10"
  164. matchread 30
  165. inctries
  166. iftries 3 63
  167. ! no response, try escape sequence
  168. pause 5
  169. write "+++"
  170. matchclr
  171. matchstr 1 62 "OK\13\10"
  172. matchread 15
  173. !
  174. ! No response from modem, toggle DTR
  175. !
  176. DTRClear
  177. pause 5
  178. DTRSet
  179. jump 61
  180. ! Pause 1 second before to ensure we meet the escape time delay
  181. @LABEL 62
  182. pause 10
  183. Flush
  184. write "ATH\13"
  185. matchstr 1 63 "OK\13\10"
  186. matchstr 2 63 "NO CARRIER\13\10"
  187. matchstr 3 63 "ERROR\13\10"
  188. matchread 30
  189. jump 61
  190. !
  191. ! Recall factory settings
  192. !
  193. @LABEL 63
  194. matchclr
  195. matchstr 1 64 "OK\13\10"
  196. write "AT&F0\13"
  197. matchread 30
  198. ! turn off auto answer, set S51 so modem will check interface speed on next command
  199. @LABEL 64
  200. matchclr
  201. matchstr 1 65 "OK\13\10"
  202. write "ATS51=254S0=0\13"
  203. matchread 30
  204. !
  205. @LABEL 65
  206. exit 0
  207.